package com.qidian.mes.pojo;

import lombok.Getter;

import java.util.List;

/**
 * @Author 任超
 * Time 2024/10/15 19:24
 */
@Getter
public class MachineType {
    private Long machineTypeId;
    private String machineTypeCode;
    private String machineTypeName;
    private Integer machineTypeStatus;
    private String machineTypeNotes;
    private Integer typeParent;
    private Long typeParentId;

    private List<MachineType> children;
    private Boolean hasChildren;

    public MachineType(Long machineTypeId, String machineTypeCode, String machineTypeName) {
        this.machineTypeId = machineTypeId;
        this.machineTypeCode = machineTypeCode;
        this.machineTypeName = machineTypeName;
        this.hasChildren = false;
    }

    public Long getMachineTypeId() {
        return machineTypeId;
    }

    public void setMachineTypeId(Long machineTypeId) {
        this.machineTypeId = machineTypeId;
    }

    public String getMachineTypeCode() {
        return machineTypeCode;
    }

    public void setMachineTypeCode(String machineTypeCode) {
        this.machineTypeCode = machineTypeCode;
    }

    public String getMachineTypeName() {
        return machineTypeName;
    }

    public void setMachineTypeName(String machineTypeName) {
        this.machineTypeName = machineTypeName;
    }

    public Integer getMachineTypeStatus() {
        return machineTypeStatus;
    }

    public void setMachineTypeStatus(Integer machineTypeStatus) {
        this.machineTypeStatus = machineTypeStatus;
    }

    public String getMachineTypeNotes() {
        return machineTypeNotes;
    }

    public void setMachineTypeNotes(String machineTypeNotes) {
        this.machineTypeNotes = machineTypeNotes;
    }

    public Integer getTypeParent() {
        return typeParent;
    }

    public void setTypeParent(Integer typeParent) {
        this.typeParent = typeParent;
        if (this.typeParent.equals(new Integer(1))) {
            this.hasChildren = true;
        }
    }

    public Long getTypeParentId() {
        return typeParentId;
    }

    public void setTypeParentId(Long typeParentId) {
        this.typeParentId = typeParentId;
    }

    public List<MachineType> getChildren() {
        return children;
    }

    public void setChildren(List<MachineType> children) {
        this.children = children;
    }

    public Boolean getHasChildren() {
        return hasChildren;
    }

    public void setHasChildren(Boolean hasChildren) {
        this.hasChildren = hasChildren;
    }

    @Override
    public String toString() {
        return "MachineType{" +
                "machineTypeId=" + machineTypeId +
                ", machineTypeCode='" + machineTypeCode + '\'' +
                ", machineTypeName='" + machineTypeName + '\'' +
                ", machineTypeStatus=" + machineTypeStatus +
                ", machineTypeNotes='" + machineTypeNotes + '\'' +
                ", typeParent=" + typeParent +
                ", typeParentId=" + typeParentId +
                ", hasChildren=" + hasChildren +
                '}';
    }
}